import Vue from 'vue';
import Vuex from 'vuex';
import getNewDateInfo from '@/libs/until.js';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    dateCache: getNewDateInfo.getNewDateInfo(),
  },
  mutations: {
    // 设置选中的日期
    setDateCache(state, newVal) {
      state.dateCache = newVal;
      // 每次改变后存入storage
      localStorage.dateCache = JSON.stringify(state.dateCache);
    },

  },
  actions: {

  },
});
